package com.dhj.streamTest2;

import com.dhj.streamTest.entity.Author;

import java.util.List;

import static com.dhj.streamTest.entity.AuthorList.getAuthors;

public class Demo1 {

    public static void main(String[] args) {
        List<Author> authors = getAuthors();

        authors.stream().distinct().forEach(author -> System.out.println(author.getName()));

        System.out.println("------------------------");

        authors.stream().distinct().map(author -> author.getName())
                .forEach(name -> System.out.println(name));

    }
}
